<?php

namespace App\Http\Requests\Api\V1_9_3;

use Illuminate\Foundation\Http\FormRequest;

class DistributRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'date_format' => 'required',
            'date_format_type' => 'required',
            'group_member_id' => 'required',
            'start_date' => 'required|date_format:"Ymd"',
            'end_date' => 'required|date_format:"Ymd"',
        ];
    }

    public function messages()
    {
        return [
            'date_format.required' => '日期格式不能为空',
            'date_format_type.required' => '日期格式类型不能为空',
            'group_member_id.required' => '团队成员id不能为空',
            'start_date.date_format' => '开始日期格式不正确',
            'end_date.date_format' => '结束日期格式不正确',
        ];
    }
}
